package com.crm.jpaandthymeleaf.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author 周敬
 * @version 1.0
 * @packageName com.crm.jpaandthymeleaf.entity
 * @fileName Orders
 * @createTime 2021/12/15-20:19-星期三
 * @lastModify 2021/12/15-20:19-星期三
 */
@Entity
public class Orders {
    private long odrId;
    private String odrCustomer;
    private Timestamp odrDate;
    private String odrAddr;
    private String odrStatus;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "odr_id")
    public long getOdrId() {
        return odrId;
    }

    public void setOdrId(long odrId) {
        this.odrId = odrId;
    }

    @Basic
    @Column(name = "odr_customer")
    public String getOdrCustomer() {
        return odrCustomer;
    }

    public void setOdrCustomer(String odrCustomer) {
        this.odrCustomer = odrCustomer;
    }

    @Basic
    @Column(name = "odr_date")
    public Timestamp getOdrDate() {
        return odrDate;
    }

    public void setOdrDate(Timestamp odrDate) {
        this.odrDate = odrDate;
    }

    @Basic
    @Column(name = "odr_addr")
    public String getOdrAddr() {
        return odrAddr;
    }

    public void setOdrAddr(String odrAddr) {
        this.odrAddr = odrAddr;
    }

    @Basic
    @Column(name = "odr_status")
    public String getOdrStatus() {
        return odrStatus;
    }

    public void setOdrStatus(String odrStatus) {
        this.odrStatus = odrStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Orders orders = (Orders) o;
        return odrId == orders.odrId && Objects.equals(odrCustomer, orders.odrCustomer) && Objects.equals(odrDate, orders.odrDate) && Objects.equals(odrAddr, orders.odrAddr) && Objects.equals(odrStatus, orders.odrStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hash(odrId, odrCustomer, odrDate, odrAddr, odrStatus);
    }
}
